package com.xujie.sportsmeeting.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;

/**
 * 用户数据传输对象
 */
@Data
@Schema(description = "用户数据传输对象")
public class UserDTO {

    @Schema(description = "用户名", example = "admin")
    @NotBlank(message = "用户名不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9_]{3,20}$", message = "用户名只能包含字母、数字和下划线，长度3-20位")
    private String username;

    @Schema(description = "密码", example = "123456")
    private String password;

    @Schema(description = "真实姓名", example = "管理员")
    @NotBlank(message = "真实姓名不能为空")
    private String realName;

    @Schema(description = "性别 0-男 1-女", example = "0")
    private Integer gender;

    @Schema(description = "手机号", example = "13800138000")
    @Pattern(regexp = "^1[3-9]\\d{9}$", message = "手机号格式不正确")
    private String phone;

    @Schema(description = "邮箱", example = "admin@example.com")
    @Email(message = "邮箱格式不正确")
    private String email;

    @Schema(description = "所在部门", example = "信息技术部")
    private String department;

    @Schema(description = "班级", example = "计算机2023-1班")
    private String className;

    @Schema(description = "状态 0-禁用 1-正常", example = "1")
    private Integer status;
}
